<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.global.js"></script>
</head>
<body>
      <div id="app">
        <!-- <span v-text="msg">{{msg}}</span> -->
        <span v-text="html"></span>
        <span v-html="html"></span>
        <textarea name="" id="" cols="30" rows="10" v-model="textarea"></textarea>

        <!-- <span v-html="textarea"></span> -->
        <div style="font-size: 20px;color: red;">
            <span v-if="textarea==='1'">1</span>
            <span v-else-if="textarea==='2'">2</span>
            <span v-else>其他</span>
        </div>
        <span v-on:click="myAlert(1)">弹窗1</span>
        <span @click="myAlert(2)">弹窗2</span>

      </div>
</body> 
<script>
 /* 
   * v-text->缩略写法{{}} 二者都存在的话，只会绑定展示一个值，不会重复显示
   * v-html ->解析html标签并展示效果
   * v-if v-else-if v-else
   * 如果一个元素需要反复展示和隐藏 用v-show 反之用v-if
   * v-bind:标签元素->缩写：
   * v-on:绑定事件 ->@
   **/
  function myAlert(){

  }
const App = {
      data() {
        return {
            textarea:'',
             msg:'msg',
             html:"<h2>111</h2>"

        }
      },
      methods:{
          myAlert(msg){
              alert(msg)
          }
      },
    }
    Vue.createApp(App).mount('#app')
</script>
</html>